<template>
    <el-input v-model="input" @input="debouncedClick" style="width:300px"/>
    <el-button type="primary" @click="btnDebounce('函数','防抖节流')">函数防抖节流</el-button>
</template>

<script setup>
  import _ from 'lodash'
  import {ref} from 'vue'
  const input=ref('')
  const handleInput=(value)=>{
    console.log(value,"000000")
  }
  const btn=(v1,v2)=>{
    console.log(v1,v2,"1111111")
  }
  const debouncedClick=_.debounce(handleInput, 500) //防抖
  const btnDebounce=_.debounce(btn, 500)  //防抖

  // const handleInput=(value)=>{
  //   console.log(value,"000000")
  // }
  // const btn=(v1,v2)=>{
  //   console.log(v1,v2,"1111111")
  // }
  // const debouncedClick=_.throttle(handleInput, 1000) //节流
  // const btnDebounce=_.throttle(btn, 1000) //节流
</script>

<style scoped>

</style>